#pragma once


namespace yazi{
namespace utility{


template<class T>
class Singleton{
public:
    static T* instance(){
        if (m_inst == NULL)
            m_inst = new T();
        return m_inst;
    }

private:
    Singleton() {}
    Singleton(const Singleton<T>& s) {}
    Singleton<T>& operator = (const Singleton<T>& s) { return s; }
    ~Singleton() {}

private:
    static T* m_inst;
};

template<class T> 
T* Singleton<T>::m_inst = NULL;

}}